package org.chen.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;

import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("comment_task")
public class CommentTask extends Model<CommentTask> {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    @TableField("batch_no")
    private String batchNo;          // 批次ID
    @TableField("target_url")
    private String targetUrl;        // 目标URL
    @TableField("comment_content")
    private String commentContent;    // 评论内容
    @TableField("nickname")
    private String nickname;         // 昵称
    @TableField("email")
    private String email;            // 邮箱
    @TableField("website_url")
    private String websiteUrl;       // 网站链接

    @TableField("is_executed")
    private Boolean isExecuted;      // 是否已执行

    @TableField("execution_time")
    private LocalDateTime executionTime;  // 执行时间

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField("status")
    private String status;           // 任务状态：PENDING, PROCESSING, SUCCESS, FAILED
    @TableField("error_message")
    private String errorMessage;     // 错误信息
    @TableField("new_comment_url")
    private String newCommentUrl;    // 评论成功后的新URL
    @TableField("retry_count")
    private Integer retryCount;      // 重试次数
}